#pragma once

#ifdef XLOG_HEADER_ONLY

#include "log/logger.h"
#include "log/sinks/log_sink_base.h"
#include "log/log_msg.h"
//#warning "logger_inl.h -> deprecated"

namespace xlog {

logger::~logger()
{
}

void logger::set_level(const log_level level)
{
    m_level = level;
    // TODO
}

void logger::log_it(log_msg msg)
{
    for (auto &sink: m_sinks)
    {
        sink->sink(msg);
    }
    bool should_flush = true;
    if (should_flush)
    {
        flush();
    }
}

void logger::flush()
{
    for (auto &sink: m_sinks)
    {
        sink->flush();
    }
}

}

#endif